package com.ssy.lingxi.logistics.repository;

import com.ssy.lingxi.logistics.entity.ReceiverAddress;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 收货地址实体仓库
 * @author yzc
 * @version 2.0.0
 * @date 2020/7/13
 */
public interface ReceiverAddressRepository extends JpaRepository<ReceiverAddress, Long>, JpaSpecificationExecutor<ReceiverAddress> {

    List<ReceiverAddress> findAllByIsDefaultAndMemberIdAndRoleId(Integer isDefault, Long memberId, Long roleId);

    ReceiverAddress findByStoreIdAndMemberIdAndRoleId(Long storeId, Long memberId, Long roleId);

    void deleteByStoreIdAndMemberIdAndRoleId(Long storeId, Long memberId, Long roleId);
}